// LibraryItem.java (抽象类)
package Object.work.model;

public abstract class LibraryItem {
    private String id;
    private String title;
    private int year;

    public LibraryItem(String id, String title, int year) {
        this.id = id;
        this.title = title;
        this.year = year;
    }

    // 抽象方法
    public abstract String getItemType();

    // Getters and Setters
    public String getId() {
        return id;
    }

    public String getTitle() {
        return title;
    }

    public int getYear() {
        return year;
    }

    @Override
    public String toString() {
        return getItemType() + " [ID: " + id + ", Title: " + title + ", Year: " + year + "]";
    }
}